#include<iostream>
using namespace std;
const int N = 210;
int way[N];
int n, m;
void dfs(int u ,int last)
{
	if (u > m) {
		for (int i = 1; i <= m; i++) {
			cout << way[i] << " ";
		}
		puts("");
		return;
	}
	for (int i = last; i <= n; i++) {
		way[u] = i;
		dfs(u + 1, i + 1);
		way[u] = 0;
	}
}
int main()
{
	cin >> n >> m;
	dfs(1, 1);
	return 0;
}